<template>
	<view class="p30">
		<view class="flex row-between col-end">
			<text>{{noticeData.name}}</text>
			<text class="color8 fs24">{{noticeData.create_time}}</text>
		</view>
		<view class="mt30" v-html="noticeData.detail"></view>
	</view>
</template>

<script>
	export default {
		name:"noticeDetail",
		data() {
			return {
				id: '',
				noticeData: {},
				//from==1朋友圈公告
				from:''
			};
		},
		onLoad(option) {
			console.log(option)
			if(option.from) {
				this.from=option.from
			}
			this.id = option.id
			this.getData()
		},
		methods: {
			getData () {
				let api=''
				// this.from==1? api='article_detail' : api=''
				if(this.from==1) {
					this.$api.article_detail({article_id: this.id}).then(res => {
						this.noticeData = res.data.data
					})
				}else {
					this.$api.announce_detail({announce_id: this.id}).then(res => {
						this.noticeData = res.data.data
					})
				}
				
			}
		}
	}
</script>

<style lang="scss">

</style>
